package net.sxnic.ugr.menu.util;

import net.sxnic.ugr.menu.Menu;

public class MenuUtils {
	public static String  treatUrl(Menu m){
		String url = m.getUrl();
		if((!url.endsWith(".jspa")&&!url.contains (".jspa"))&&!url.contains (".jsp")){
			url = url +".jspa";
		}
		if(url.contains("?")){
			url = url+"&menuCode="+m.getCode();
		}else{
			url = url+"?menuCode="+m.getCode();
		}
		
		return url;
		
	}
	
	public static String treatMenuCode(String code){
		return String.valueOf(Integer.parseInt(code));
	}
}
